package deprecated;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

/**
 * @ProjectName:zqdk-mvcbase
 * @Description: 
 * @author: 周楠
 * @date 2017年3月6日 下午3:32:14
 */

public class DefaultExceptionHandler extends AbstractExceptionHandler<Exception>{

	
	@Override
	public ModelAndView doHandlerException(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception exception) {
		

		if(log.isErrorEnabled()){
		log.error(exception);
		}
		
		exception.printStackTrace();
		
		ModelAndView mv=new ModelAndView();
		
		mv.addObject("exception", exception);
		
		mv.addAllObjects(new HashMap<String,Object>());
		
		return mv;
	}

}
